#include <vtkMath.h>

//求两个3D点之间的平方距离和欧几里得距离
int main(int argc, char *argv[])
{
    double p0[3] = {0.0, 0.0, 0.0};
    double p1[3] = {1.0, 1.0, 1.0};

    //计算两个点之间的平方距离
    double squaredDistance = vtkMath::Distance2BetweenPoints(p0, p1);

    //计算平方根之后得到实际距离
    double distance = std::sqrt(squaredDistance);

    std::cout << "SquaredDistance = " << squaredDistance << std::endl;
    std::cout << "Distance = " << distance << std::endl;

    return EXIT_SUCCESS;
}